package com.MovieManageSystem.service.implement;

import com.MovieManageSystem.domain.Feedback;
import com.MovieManageSystem.mapper.FeedbackMapper;
import com.MovieManageSystem.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    private FeedbackMapper feedbackMapper;

    @Override
    public void submitFeedback(Feedback feedback) {
        feedbackMapper.insertFeedback(feedback);
    }

    @Override
    public Feedback getFeedbackById(Integer fid) {
        return feedbackMapper.findFeedbackById(fid);
    }

    @Override
    public List<Feedback> getAllFeedbacks() {
        return feedbackMapper.findAllFeedbacks();
    }

    @Override
    public void deleteFeedbackByFid(Integer fid) {
        feedbackMapper.deleteFeedbackByFid(fid);
    }
}
